﻿using System;

namespace Parameter
{
     
    class Program
    {
        

        static void Main(string[] args)
        {

            int maxIndex;
            int[]  Array = { 6, 16, 26, 36, 46 };
            int maxValue =OutputParameter. MaxValue( Array, out maxIndex);
            Console.WriteLine($"maxValue = {maxValue}, maxIndex = {maxIndex}.");
            




            int a = 1;
            int b = 2;
            Console.WriteLine($"a = {a}, b = {b}");
          ReferenceParameter.SwapInts(ref a, ref b);
            Console.WriteLine($"a = {a}, b = {b}");
             



            UseParams(1, 2, 3);  

            int[] myarray = new int[3] { 10, 11, 12 };
            UseParams(myarray);    

            UseParams1(1, 'a', new object());
        }

        public static void UseParams(params int[] list)
        {
            for (int i = 0; i < list.Length; i++)
            {
                Console.WriteLine(list[i]);
            }
            Console.WriteLine();
        }

        public static void UseParams1(params object[] list)
        {
            for (int i = 0; i < list.Length; i++)
            {
                Console.WriteLine(list[i]);
            }
            Console.WriteLine();



        }

       
    }
}
